//
//  HomeNavigationVIew.m
//  Arts1
//
//  Created by Mac Jc on 15/10/4.
//  Copyright © 2015年 Arts1. All rights reserved.
//

#import "HomeNavigationVIew.h"
#import "AllHeader.h"

@implementation HomeNavigationVIew

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        
        
        UIView *backgroundView = [[UIView alloc] initWithFrame:self.bounds];
        backgroundView.backgroundColor = [UIColor whiteColor];
        [self addSubview:backgroundView];
//        [UIView viewWideForShadowColor:backgroundView];
        [UIView viewShadowColor:backgroundView];
        
        
        [backgroundView addSubview:self.backButton];
        [backgroundView addSubview:self.titleLabel];
        //        [backgroundView addSubview:self.subTitlelabel];
        [backgroundView addSubview:self.shareBTN];
        
    }
    return self;
}

- (UIButton *)backButton{
    if (!_backButton) {
        _backButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _backButton.frame = CGRectMake(8, 8, 28 , 28);
        //        [_backButton setTitle:@"<" forState:(UIControlStateNormal)];
        [_backButton setImage:[UIImage imageNamed:@"backButton"] forState:(UIControlStateNormal)];
        //        [_backButton setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    }
    return _backButton;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 13, SCREEN_WIDTH - 100, 17)];
        _titleLabel.text = @"中央美术学院";
        _titleLabel.textColor = sFONTCOLOR;
        _titleLabel.font = [UIFont systemFontOfSize:14];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLabel;
}

- (UILabel *)subTitlelabel{
    if (!_subTitleLabel) {
        _subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, _titleLabel.bottom + 2, SCREEN_WIDTH - 100, 11)];
        _subTitleLabel.text = @"北京";
        _subTitleLabel.textColor = sFONTCOLOR;
        _subTitleLabel.font = [UIFont boldSystemFontOfSize:12];
        _subTitleLabel.textAlignment = NSTextAlignmentCenter;
    }
    return _subTitleLabel;
}


- (UIButton *)shareBTN{
    if (!_shareBTN) {
        _shareBTN = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _shareBTN.frame = CGRectMake(SCREEN_WIDTH - 44, 5, 34 , 34);
        [_shareBTN setImage:[UIImage imageNamed:@"share"] forState:(UIControlStateNormal)];
        [_shareBTN setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
    }
    return _shareBTN;
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
